//
//  CZQClubDetailTCell.m
//  coachmanage
//
//  Created by 众拳科技 on 2018/3/22.
//  Copyright © 2018年 众拳科技. All rights reserved.
//

#import "CZQClubDetailTCell.h"
@implementation CZQClubDetailSettionHeadView

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        
        self.backgroundColor = CSWhiteColor;
        
        /**
         门店介绍
         */
        UILabel *clubNameLable = [UILabel new];
        clubNameLable.text = @"门店介绍";
        clubNameLable.font = TitleBoldFont;
        clubNameLable.numberOfLines = 0;
        clubNameLable.textColor = BlackColor;
        [self addSubview:clubNameLable];
        self.clubNameLable = clubNameLable;

        
        [self setConstraints];
    }
    return self;
}

-(void)setConstraints
{
    [self.clubNameLable mas_remakeConstraints:^(MASConstraintMaker *make) {
        
        make.right.bottom.mas_equalTo(self).offset(-10);
        
        make.left.top.mas_equalTo(self).offset(10);
        make.width.mas_equalTo(30);
    }];
    
}

@end
@implementation CZQClubDetailHeadView

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        
        self.backgroundColor = CSWhiteColor;
        
        /**
         场地图片
         */
        UIImageView *jobImageView = [UIImageView new];
        jobImageView.image = PlaceHold;
        [self addSubview:jobImageView];
        self.jobImageView = jobImageView;
        
        /**
         场地地址
         */
        UILabel *jobAddressLable = [UILabel new];
        jobAddressLable.text = @"九江市艺术中心";
        jobAddressLable.font = MidFont;
        jobAddressLable.numberOfLines = 0;
        jobAddressLable.textColor = GrakColor;
        [self addSubview:jobAddressLable];
        self.jobAddressLable = jobAddressLable;
        
        
        
        
        /**
         场地地址
         */
        UIButton *jobAddressBtn = [UIButton buttonWithType:UIButtonTypeCustom];
        jobAddressBtn.contentEdgeInsets = UIEdgeInsetsMake(5, 10, 5, 10);
        [jobAddressBtn setImage:@"icon_distance"];
        [self addSubview:jobAddressBtn];
        self.jobAddressBtn = jobAddressBtn;

        
        [self setConstraints];
    }
    return self;
}

-(void)setConstraints
{
    
    /**
     场地图片
     */
    [self.jobImageView mas_remakeConstraints:^(MASConstraintMaker *make) {
        
        make.left.top.mas_equalTo(self).offset(10);
        make.right.mas_equalTo(self).offset(-10);
        make.height.mas_equalTo(self.jobImageView.mas_width).multipliedBy(0.5);
        
    }];
    
    
    
   
    /**
     场地地址
     */
    [self.jobAddressLable mas_remakeConstraints:^(MASConstraintMaker *make) {
        
        make.top.mas_equalTo(self.jobImageView.mas_bottom).offset(10);
        make.left.mas_equalTo(self).offset(10);
        make.bottom.mas_equalTo(self).offset(-10);
        
        
    }];
    
    
    /**
     场地地址
     */
    
    [self.jobAddressBtn mas_remakeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(self.jobAddressLable.mas_right).offset(10);
        make.centerY.mas_equalTo(self.jobAddressLable);
        make.right.mas_equalTo(self).offset(-10);
        make.width.mas_equalTo(40);
        
        
    }];
}

@end

@implementation CZQClubDetailTCell
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        
        
        /**
         题目
         */
        UILabel *nameLable = [UILabel new];
        nameLable.text = @"九江市艺术中心";
        nameLable.font = MidFont;
        nameLable.numberOfLines = 0;
        nameLable.textColor = GrakColor;
        [self addSubview:nameLable];
        self.nameLable = nameLable;
        
        /**
         题目内容
         */
        UILabel *titleLable = [UILabel new];
        titleLable.text = @"九江市艺术中心";
        titleLable.font = MidFont;
        titleLable.numberOfLines = 0;
        titleLable.textColor = BlackColor;
        [self addSubview:titleLable];
        self.titleLable = titleLable;
        
        [self setConstraints];
        
        
    }
    return self;
}


-(void)setConstraints
{
    
    /**
     题目
     */
    [self.nameLable mas_remakeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(self).offset(10);
        make.top.mas_equalTo(self).offset(10);
        
        
        
    }];
    
    
    
    /**
     题目内容
     */
    [self.titleLable mas_remakeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(self.nameLable.mas_right).offset(10);
        make.top.mas_equalTo(self.nameLable);
        make.right.lessThanOrEqualTo(self).offset(-10);
        make.bottom.mas_equalTo(self).offset(-10);
        
    }];
}
- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
